package shinesend.com.cn.valaanimtordemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {

    private ImageView main_imageview;
    //
    Animation animation;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        //播放动画的控件;
        main_imageview = (ImageView) findViewById(R.id.main_imageview);
        animation = AnimationUtils.loadAnimation(this,R.anim.main_anim);

    }

    public void start(View view){
        //开始动画;
        main_imageview.startAnimation(animation);
    }

    public void stop(View view){
        //停止动画;
        main_imageview.clearAnimation();
    }

}
